FROM golang:alpine AS builder

RUN mkdir /app
#相当于linux跑的cd
WORKDIR /app

COPY  ./ ./

ENV GOPROXY https://goproxy.cn,direct

RUN go build main.go

FROM scratch

WORKDIR /app

COPY --from=builder /app/main ./main
COPY --from=builder /app/dev.yaml ./dev.yaml

CMD ["./main"]